package web.dmt.dao.proxy ;
import web.dmt.dao.*;
import web.dmt.db.*;
import web.dmt.dao.impl.* ;
import web.dmt.vo.Share;

import java.sql.* ;
import java.util.*;

public class ShareProxy implements ShareDAO{
	private Conn dbc = null ;
	private ShareImpl dao = null ;
	public ShareProxy(){
		try{
			this.dbc = new Conn();
		}catch(Exception e){
			e.printStackTrace() ;
		}
		this.dao = new ShareImpl(dbc.getConnection());
	}
	public void upload(String title, String path, String uid,String hz) throws Exception {
		 try{
			this.dao.upload(title, path, uid, hz) ;
		 }catch(Exception e){
			 e.printStackTrace() ;
		 }finally{
			 this.dbc.close();
		 }
	}
	public List<Share> select() throws Exception {
		List<Share> list= null ;
		try{
			list = this.dao.select() ;
		}catch(Exception e){
			e.printStackTrace() ;
		}finally{
			this.dbc.close() ;
		}
		return list;
	}
	public List<Share> find(String str) throws Exception {
		List<Share> list = null ;
		try{
			list = this.dao.find(str) ;
		}catch(Exception e){
			e.printStackTrace() ;
		}finally{
			this.dbc.close() ;
		}
		return list;
	}
}